/**
 * 
 */
package pATT.DataSetsGenerator.dataSetsGenerator.converter.implement;

import java.io.File;

import javax.swing.JFileChooser;

import pATT.core.Chooser.ImageFilter;

/**
 * @author Ignacio
 *
 */
public abstract class Converter {

	protected String relationName = "";
	
	public String getRelationName() {
		return relationName;
	}

	/**
	 * Convierte a arff
	 * */
	public abstract String convert()throws Exception;
	
	/**
	 * This method initializes jOpenFileButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	protected File openFile(final String extension) {
					JFileChooser fc = new JFileChooser();
					
					fc.setBackground(java.awt.SystemColor.control);
					ImageFilter ifa = new ImageFilter(extension);
					fc.addChoosableFileFilter(ifa);
					int returnVal = fc.showOpenDialog(fc);
					
	
					
					if (returnVal == JFileChooser.APPROVE_OPTION) {			
//						if(ifa.isArffFileValid(fc.getSelectedFile())){
//						}
//						else{
//							Logger.log(Message.OPEN_FILE_ERROR);
//							
//						}
					}
		return fc.getSelectedFile();				
	}

}
